/**
 *
 * @author echaimae
 */
package gdn;

//import ispose.pdf.*;
import com.itextpdf.text.BaseColor;
import com.itextpdf.text.FontFactory;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Image;

import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import java.awt.Desktop;
import java.awt.print.PrinterException;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.event.ListSelectionEvent;
import javax.swing.table.DefaultTableModel;
//import javax.swing.text.Document;
//****************************************************************************
//fenetre principale de l'application
//*************************************************************************
public class Gui extends javax.swing.JFrame {
    private Object Document_path;
//*******************************************
    //constructeur de la fenetre
    //*********************************************
    public Gui() {
      //setContentPane(new JLabel(new ImageIcon(getClass().getClassLoader().getResource("C:\\Users\\echaimae\\Desktop\\background.jpg"))));
initComponents();
      pan_add.setVisible(false);
     Nv_note.setVisible(false);
     modification_module.setVisible(false);
     pan_ajoutModul.setVisible(false);
     pan_modifnommod.setVisible(false);
     pan_excel.setVisible(false);
    }
    @SuppressWarnings("unchecked")
       //*********************************
            //connexion avec la bdd
               //*******************************
    String url ="jdbc:mysql://127.0.0.1:3306/gdt_db";
    Connection conn;
    Statement st;
    ResultSet rs;
    //**********************************************
       //creation de table qui va contenir resultat du boutton
          //**********************************************
     public DefaultTableModel setResultModel(Object[][] data,String[] columnNames){
         DefaultTableModel t = new DefaultTableModel();
        t.setDataVector(data, columnNames);
            return t;
    } 
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        filiere_box = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        cne_lab = new javax.swing.JLabel();
        cne_txt = new javax.swing.JTextField();
        jPanel6 = new javax.swing.JPanel();
        btn_modifModul = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        btn_modifNote = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        btn_consult = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        btn_reinscript = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        pan_result = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        resultCon = new javax.swing.JTable();
        pan_consulter = new javax.swing.JPanel();
        valider_consult = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        pan_modifModule = new javax.swing.JPanel();
        modif_module = new javax.swing.JButton();
        supprimer_module = new javax.swing.JButton();
        ajout_module = new javax.swing.JButton();
        pan_modifNote = new javax.swing.JPanel();
        modif_note = new javax.swing.JButton();
        pan_reinscrire = new javax.swing.JPanel();
        reinscrireBtn = new javax.swing.JButton();
        pan_add = new javax.swing.JPanel();
        user = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        pass = new javax.swing.JPasswordField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        Nv_note = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        valid_note = new javax.swing.JButton();
        module = new javax.swing.JComboBox();
        n = new javax.swing.JTextField();
        pann_modifmodul = new javax.swing.JPanel();
        modification_module = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        module_txt = new javax.swing.JTextField();
        semestre_txt = new javax.swing.JTextField();
        pan_modifnommod = new javax.swing.JPanel();
        modif_nomMod = new javax.swing.JButton();
        pan_ajoutModul = new javax.swing.JPanel();
        jButton7 = new javax.swing.JButton();
        pan_excel = new javax.swing.JPanel();
        path_attachment = new javax.swing.JTextField();
        jButton8 = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        print_btn = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        addUser = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(23, 197, 206));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 1611, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 118, Short.MAX_VALUE)
        );

        jPanel2.setBackground(new java.awt.Color(0, 153, 255));

        jPanel4.setOpaque(false);

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Etudiant Info", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 18))); // NOI18N
        jPanel10.setOpaque(false);

        filiere_box.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        filiere_box.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "SMI", "IGE", "GL" }));

        jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        jLabel2.setText("Filiere");

        cne_lab.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        cne_lab.setText("Cne");

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(cne_lab))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(cne_txt)
                    .addComponent(filiere_box, 0, 104, Short.MAX_VALUE)))
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cne_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cne_lab))
                .addGap(40, 40, 40)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(filiere_box, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(33, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(140, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel6.setOpaque(false);

        btn_modifModul.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        btn_modifModul.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/tutorials-folder-icon.png"))); // NOI18N
        btn_modifModul.setText("Modifier_Module");
        btn_modifModul.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_modifModulActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btn_modifModul, javax.swing.GroupLayout.DEFAULT_SIZE, 169, Short.MAX_VALUE)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btn_modifModul, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE))
        );

        jPanel7.setOpaque(false);

        btn_modifNote.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        btn_modifNote.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/edit-validated-icon.png"))); // NOI18N
        btn_modifNote.setText("Modifier_Note");
        btn_modifNote.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_modifNoteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btn_modifNote, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btn_modifNote, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE)
        );

        jPanel8.setOpaque(false);

        btn_consult.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        btn_consult.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\search-b-icon.png")); // NOI18N
        btn_consult.setText("Consulter");
        btn_consult.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_consultActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btn_consult, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(btn_consult, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel9.setOpaque(false);

        btn_reinscript.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        btn_reinscript.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\Users-icon.png")); // NOI18N
        btn_reinscript.setText("Reinscrire");
        btn_reinscript.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_reinscriptActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btn_reinscript, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btn_reinscript, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 49, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(154, 154, 154)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(666, Short.MAX_VALUE))
        );

        jPanel3.setBackground(new java.awt.Color(23, 197, 206));

        pan_result.setVisible(false);
        pan_result.setOpaque(false);

        resultCon.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        resultCon.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4", "boolean"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Boolean.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane1.setViewportView(resultCon);

        javax.swing.GroupLayout pan_resultLayout = new javax.swing.GroupLayout(pan_result);
        pan_result.setLayout(pan_resultLayout);
        pan_resultLayout.setHorizontalGroup(
            pan_resultLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_resultLayout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 553, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        pan_resultLayout.setVerticalGroup(
            pan_resultLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_resultLayout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 33, Short.MAX_VALUE))
        );

        pan_consulter.setVisible(false);
        pan_consulter.setOpaque(false);

        valider_consult.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        valider_consult.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/Sign-Forward-icon.png"))); // NOI18N
        valider_consult.setText("Valider");
        valider_consult.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                valider_consultActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pan_consulterLayout = new javax.swing.GroupLayout(pan_consulter);
        pan_consulter.setLayout(pan_consulterLayout);
        pan_consulterLayout.setHorizontalGroup(
            pan_consulterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_consulterLayout.createSequentialGroup()
                .addComponent(valider_consult, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 411, Short.MAX_VALUE))
        );
        pan_consulterLayout.setVerticalGroup(
            pan_consulterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pan_consulterLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(valider_consult, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(27, 27, 27))
        );

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/fpo.jpg"))); // NOI18N

        pan_modifModule.setVisible(false);
        pan_modifModule.setOpaque(false);

        modif_module.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        modif_module.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\Files-Edit-file-icon.png")); // NOI18N
        modif_module.setText("Modifier");
        modif_module.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modif_moduleActionPerformed(evt);
            }
        });

        supprimer_module.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        supprimer_module.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\delete-icon.png")); // NOI18N
        supprimer_module.setText("Supprimer");
        supprimer_module.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                supprimer_moduleActionPerformed(evt);
            }
        });

        ajout_module.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        ajout_module.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\add-icon.png")); // NOI18N
        ajout_module.setText("Ajouter");
        ajout_module.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ajout_moduleActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pan_modifModuleLayout = new javax.swing.GroupLayout(pan_modifModule);
        pan_modifModule.setLayout(pan_modifModuleLayout);
        pan_modifModuleLayout.setHorizontalGroup(
            pan_modifModuleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_modifModuleLayout.createSequentialGroup()
                .addComponent(modif_module, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(42, 42, 42)
                .addComponent(supprimer_module, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
                .addComponent(ajout_module, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        pan_modifModuleLayout.setVerticalGroup(
            pan_modifModuleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(modif_module, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(supprimer_module, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(ajout_module, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
        );

        pan_modifNote.setVisible(false);
        pan_modifNote.setOpaque(false);

        modif_note.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        modif_note.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\Actions-edit-redo-icon.png")); // NOI18N
        modif_note.setText("Modifier");
        modif_note.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modif_noteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pan_modifNoteLayout = new javax.swing.GroupLayout(pan_modifNote);
        pan_modifNote.setLayout(pan_modifNoteLayout);
        pan_modifNoteLayout.setHorizontalGroup(
            pan_modifNoteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_modifNoteLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(modif_note, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE)
                .addContainerGap())
        );
        pan_modifNoteLayout.setVerticalGroup(
            pan_modifNoteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_modifNoteLayout.createSequentialGroup()
                .addComponent(modif_note, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
                .addContainerGap())
        );

        pan_reinscrire.setVisible(false);
        pan_reinscrire.setOpaque(false);

        reinscrireBtn.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        reinscrireBtn.setText("Reinscrire");
        reinscrireBtn.setOpaque(false);
        reinscrireBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reinscrireBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pan_reinscrireLayout = new javax.swing.GroupLayout(pan_reinscrire);
        pan_reinscrire.setLayout(pan_reinscrireLayout);
        pan_reinscrireLayout.setHorizontalGroup(
            pan_reinscrireLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pan_reinscrireLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(reinscrireBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))
        );
        pan_reinscrireLayout.setVerticalGroup(
            pan_reinscrireLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_reinscrireLayout.createSequentialGroup()
                .addComponent(reinscrireBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pan_add.setOpaque(false);

        user.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/Sign-Select-icon.png"))); // NOI18N
        jButton2.setText("valider");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        jLabel4.setText("Entrez nom d'utilisateur :");

        jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        jLabel5.setText("Entrez mot de passe");

        javax.swing.GroupLayout pan_addLayout = new javax.swing.GroupLayout(pan_add);
        pan_add.setLayout(pan_addLayout);
        pan_addLayout.setHorizontalGroup(
            pan_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_addLayout.createSequentialGroup()
                .addGroup(pan_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pan_addLayout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addGroup(pan_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(pan_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(user, javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)
                            .addComponent(pass)))
                    .addGroup(pan_addLayout.createSequentialGroup()
                        .addGap(95, 95, 95)
                        .addComponent(jButton2)))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        pan_addLayout.setVerticalGroup(
            pan_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_addLayout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addGroup(pan_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(user, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(pan_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(pass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton2)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        Nv_note.setOpaque(false);

        jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        jLabel6.setText("Entrez la nouvelle note");

        valid_note.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        valid_note.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\valid-icon.png")); // NOI18N
        valid_note.setText("Valider");
        valid_note.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                valid_noteActionPerformed(evt);
            }
        });

        module.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "S6SMI", "ALGEBRE 3" }));
        module.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                moduleActionPerformed(evt);
            }
        });

        n.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout Nv_noteLayout = new javax.swing.GroupLayout(Nv_note);
        Nv_note.setLayout(Nv_noteLayout);
        Nv_noteLayout.setHorizontalGroup(
            Nv_noteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Nv_noteLayout.createSequentialGroup()
                .addGap(43, 43, 43)
                .addGroup(Nv_noteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(module, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(valid_note, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(Nv_noteLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(n, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
                .addContainerGap())
        );
        Nv_noteLayout.setVerticalGroup(
            Nv_noteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Nv_noteLayout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addGroup(Nv_noteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel6)
                    .addComponent(n, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(module, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                .addComponent(valid_note, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pann_modifmodul.setOpaque(false);

        modification_module.setOpaque(false);

        jLabel7.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        jLabel7.setText("Module");

        jLabel8.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        jLabel8.setText("Semestre");

        javax.swing.GroupLayout modification_moduleLayout = new javax.swing.GroupLayout(modification_module);
        modification_module.setLayout(modification_moduleLayout);
        modification_moduleLayout.setHorizontalGroup(
            modification_moduleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(modification_moduleLayout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(modification_moduleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(modification_moduleLayout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(48, 48, 48)
                        .addComponent(semestre_txt))
                    .addGroup(modification_moduleLayout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addGap(56, 56, 56)
                        .addComponent(module_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(61, Short.MAX_VALUE))
        );
        modification_moduleLayout.setVerticalGroup(
            modification_moduleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(modification_moduleLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(modification_moduleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(module_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
                .addGroup(modification_moduleLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(semestre_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22))
        );

        modif_nomMod.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\Accept-icon.png")); // NOI18N
        modif_nomMod.setText("Valider");
        modif_nomMod.setOpaque(false);
        modif_nomMod.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modif_nomModActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pan_modifnommodLayout = new javax.swing.GroupLayout(pan_modifnommod);
        pan_modifnommod.setLayout(pan_modifnommodLayout);
        pan_modifnommodLayout.setHorizontalGroup(
            pan_modifnommodLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(modif_nomMod, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
        );
        pan_modifnommodLayout.setVerticalGroup(
            pan_modifnommodLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(modif_nomMod, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
        );

        jButton7.setFont(new java.awt.Font("Times New Roman", 1, 11)); // NOI18N
        jButton7.setIcon(new javax.swing.ImageIcon("C:\\Users\\echaimae\\Documents\\NetBeansProjects\\gdn\\src\\gdn\\Resource\\add-icon.png")); // NOI18N
        jButton7.setText("Ajouter");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pan_ajoutModulLayout = new javax.swing.GroupLayout(pan_ajoutModul);
        pan_ajoutModul.setLayout(pan_ajoutModulLayout);
        pan_ajoutModulLayout.setHorizontalGroup(
            pan_ajoutModulLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
        );
        pan_ajoutModulLayout.setVerticalGroup(
            pan_ajoutModulLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout pann_modifmodulLayout = new javax.swing.GroupLayout(pann_modifmodul);
        pann_modifmodul.setLayout(pann_modifmodulLayout);
        pann_modifmodulLayout.setHorizontalGroup(
            pann_modifmodulLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pann_modifmodulLayout.createSequentialGroup()
                .addGap(103, 103, 103)
                .addComponent(pan_modifnommod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 136, Short.MAX_VALUE)
                .addComponent(pan_ajoutModul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(69, 69, 69))
            .addGroup(pann_modifmodulLayout.createSequentialGroup()
                .addGap(84, 84, 84)
                .addComponent(modification_module, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pann_modifmodulLayout.setVerticalGroup(
            pann_modifmodulLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pann_modifmodulLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(modification_module, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(pann_modifmodulLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pann_modifmodulLayout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(pan_modifnommod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(pan_ajoutModul, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pan_excel.setOpaque(false);

        path_attachment.setText("jTextField1");
        path_attachment.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                path_attachmentActionPerformed(evt);
            }
        });

        jButton8.setText("jButton8");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pan_excelLayout = new javax.swing.GroupLayout(pan_excel);
        pan_excel.setLayout(pan_excelLayout);
        pan_excelLayout.setHorizontalGroup(
            pan_excelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_excelLayout.createSequentialGroup()
                .addGroup(pan_excelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pan_excelLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(path_attachment, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pan_excelLayout.createSequentialGroup()
                        .addGap(42, 42, 42)
                        .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(26, Short.MAX_VALUE))
        );
        pan_excelLayout.setVerticalGroup(
            pan_excelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pan_excelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(path_attachment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(13, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(255, 255, 255)
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 430, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(197, 197, 197)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(pan_result, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGap(105, 105, 105)
                                        .addComponent(Nv_note, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(pan_add, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel3)
                                .addGap(20, 20, 20))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(pan_modifNote, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(34, 34, 34)
                                        .addComponent(pan_reinscrire, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(pan_modifModule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(pan_consulter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(0, 0, Short.MAX_VALUE))))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(233, 233, 233)
                        .addComponent(pann_modifmodul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(30, 30, 30))
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(335, 335, 335)
                .addComponent(pan_excel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(pan_result, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(11, 11, 11)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(pan_consulter, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(pan_modifModule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(pan_reinscrire, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(pan_modifNote, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGap(60, 60, 60)
                                        .addComponent(jLabel3)))
                                .addGap(47, 47, 47)
                                .addComponent(pann_modifmodul, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(Nv_note, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(pan_add, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(pan_excel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel11.setBackground(new java.awt.Color(0, 153, 204));

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/Save-icon.png"))); // NOI18N
        jButton1.setText("Enregistrer");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        print_btn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/print-icon.png"))); // NOI18N
        print_btn.setText("Imprimer");
        print_btn.setFocusable(false);
        print_btn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        print_btn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        print_btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                print_btnActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/Sign-Refresh-icon.png"))); // NOI18N
        jButton3.setText("Actualiser");
        jButton3.setFocusable(false);
        jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/help.png"))); // NOI18N
        jButton4.setText("Aide");
        jButton4.setFocusable(false);
        jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/Logoff-icon.png"))); // NOI18N
        jButton5.setText("Fermer");
        jButton5.setFocusable(false);
        jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton5.setMaximumSize(new java.awt.Dimension(45, 45));
        jButton5.setPreferredSize(new java.awt.Dimension(60, 55));
        jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        addUser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/add-user-icon.png"))); // NOI18N
        addUser.setText("Ajouter utilisateur");
        addUser.setFocusable(false);
        addUser.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        addUser.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        addUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addUserActionPerformed(evt);
            }
        });

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gdn/Resource/Sign-Shutdown-icon.png"))); // NOI18N
        jButton6.setText("Deconnexion");
        jButton6.setFocusable(false);
        jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(print_btn, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(addUser, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(274, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(addUser, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(print_btn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jMenu1.setText("Fichier");

        jMenuItem2.setText("Ouvrir fichier excel");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem1.setText("Enregistrez sous");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem3.setText("Imprimer");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem3);

        jMenuItem4.setText("Exit");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem4);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edition");

        jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem5.setText("Actualiser");
        jMenu2.add(jMenuItem5);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Aide");
        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(51, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
//***********************************************************
   //code du boutton consultation des informations des etudiants
      //******************************************************
    private void btn_consultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_consultActionPerformed
pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(true);
pan_add.setVisible(false);
pan_consulter.setVisible(true);
modification_module.setVisible(false);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(false);
pan_excel.setVisible(false);
try {
            String [] columnNames = new String[]{"CNE","CIN","NOM","PRENOM","FILIERE","module","session","note"}; 
            conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
            if(!(cne_txt.getText().equals(""))){
                String cneEtudiant = cne_txt.getText().trim();
                String boxFiliere = filiere_box.getSelectedItem().toString(); 
                System.out.println(boxFiliere);
                int i=0;
 String query ="select etudiant.cne_etud,etudiant.cin_etud,etudiant.nom_etud,etudiant.prenom_etud,etudiant.intitule_filiere,valid.intitule_module,valid.session,valid.note from etudiant ,valid where  etudiant.cne_etud="+cneEtudiant+" and etudiant.cne_etud=valid.cne_etud;";
rs=st.executeQuery(query);
                while(rs.next()){
                    Object [][] data1 = new Object[1][9];
                    i=1;
                    System.out.println(i);
                    data1[0][0]= rs.getString(1);
                    data1[0][1]= rs.getString(2);
                    data1[0][2]= rs.getString(3);
                    data1[0][3]= rs.getString(4);
                    data1[0][4]= boxFiliere;
                    data1[0][5]= rs.getString(6);
                    data1[0][6]= rs.getString(7);
                    data1[0][7]= rs.getString(8);
                    //data1[0][8]= rs.getString(4);
                    resultCon.setModel(setResultModel(data1,columnNames));
                }
            }else{
                JOptionPane.showMessageDialog(null,"Veuillez remplir les champs avant de rechercher");
            }
        } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btn_consultActionPerformed
//*********************************************
//code du boutton de reinscription des etudiants
    //********************************************
    private void btn_reinscriptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_reinscriptActionPerformed
 pan_reinscrire.setVisible(true);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(true);
pan_add.setVisible(false);
pan_consulter.setVisible(false);
modification_module.setVisible(false);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(false);
     pan_excel.setVisible(false);
try {
            String [] columnNames = new String[]{"Module","Semestre","Reinscrire"}; 
             conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
            if(!(cne_txt.getText().equals(""))){
                String cneEtudiant = cne_txt.getText().trim();
                int i=0;  
                  String query = "select module.intitule_module,module.id_semestre from module,inscrire where "
                   + "inscrire.cne_etud='"+cneEtudiant+"'";
                rs=st.executeQuery(query);
                JCheckBox box = new JCheckBox();
                while(rs.next()){
                    Object [][] data1 = new Object[1][4];
                    i=1;
                    System.out.println(i);
                    data1[0][0]= rs.getString(1);
                    data1[0][1]= rs.getString(2);
                    data1[0][2]= Boolean.FALSE;
                   resultCon.setModel(new DefaultTableModel(data1,columnNames){
                      public Class<?> getColumnClass(int column){
                          return (getValueAt(0,column).getClass());
                      }  
                    }
                    );
                }
                System.out.println("fffffffffffffffJKKLKLL");
            }
        } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        } 
    }//GEN-LAST:event_btn_reinscriptActionPerformed
//***************************************************
//code du boutton valider
    //**********************************************
    private void valider_consultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_valider_consultActionPerformed
 Document doc = new Document();
        try{
            conn = DriverManager.getConnection(url,"root","");
        st=conn.createStatement();
                            String boxFiliere = filiere_box.getSelectedItem().toString(); 
         String cneEtudiant = cne_txt.getText().trim();
        String query = "SELECT * FROM etudiant where cne_etud like '"+cneEtudiant+"'" ;
         ResultSet infoQuery = st.executeQuery(query);
         while(infoQuery.next()){
            PdfWriter.getInstance(doc , new FileOutputStream("infos.pdf"));
                doc.open();
                SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
                Date dmnt = new Date();
                String date = dt.format(dmnt);
                                Paragraph dat = new Paragraph();

                doc.add(dat);
                Image image = Image.getInstance("images.jpg");
        doc.add(new Paragraph("\n"));
        doc.add(image);
        
        image.setAlignment(Element.ALIGN_CENTER);
        doc.add(new Paragraph("\n",FontFactory.getFont(FontFactory.TIMES_BOLD, 18)));
                Paragraph pr = new Paragraph();
                Paragraph title = new Paragraph("Fiche d'étudiant \n\n",FontFactory.getFont(FontFactory.TIMES,20,Font.BOLD,BaseColor.LIGHT_GRAY));
                image.setAlignment(Element.ALIGN_CENTER);
               
                title.setAlignment(Element.ALIGN_CENTER);
                dat.setAlignment(Element.ALIGN_RIGHT);
                
                doc.add(title);
               pr.add("\n CNE : "+infoQuery.getString("cne_etud")+" \n CIN : "+infoQuery.getString("cin_etud")+"\n");
               pr.add("Nom et prenom d'étudiant : "+infoQuery.getString("nom_etud")+" "+infoQuery.getString("prenom_etud")+"\n");
               pr.add("Sexe: "+infoQuery.getString("sexe")+" \n");
               doc.add(pr);
         }
         String note = "SELECT * FROM valid where cne_etud = '"+cneEtudiant+"'" ;
           ResultSet noteQuery = st.executeQuery(note);
           while(noteQuery.next()){
                PdfPTable tb = new PdfPTable(2);
                tb.addCell("Module");
                tb.addCell("Note");
                String noteValid = noteQuery.getString(3);
                String nomModule  = noteQuery.getString(2);
             tb.addCell(nomModule);                 
                tb.addCell(noteValid);
                doc.add(tb);
            //while2
        }//while1  
                doc.close();
                 Desktop opn = Desktop.getDesktop();
                if(opn.isSupported(Desktop.Action.OPEN)){
                    opn.open(new File("infos.pdf"));
                }else{
                    System.out.println("Imossible d'ouvrir le fichier ");
                }
         }catch(SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        } catch (DocumentException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_valider_consultActionPerformed
//**********************************************************************************
//codedu boutton modificatioModule qui permet demodifier  les intitule des modules
    //*********************************************************************************
    private void btn_modifModulActionPerformed(java.awt.event.ActionEvent evt) {                                               
        pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(true);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(true);
pan_add.setVisible(false);
pan_consulter.setVisible(false);
modification_module.setVisible(false);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(false);
pan_excel.setVisible(false);
try {
            String [] columnNames = new String[]{"Module","Semestre","Filiere"}; 
            conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
            if(!(cne_txt.getText().equals(""))){
                String cneEtudiant = cne_txt.getText().trim();
                String boxFiliere = filiere_box.getSelectedItem().toString(); 
                System.out.println(boxFiliere);
               int i=0;
 String query = "select m.intitule_module,m.id_semestre,i.intitule_filiere from inscrire i,module m where m.id_module=i.id_module and "+
         "i.cne_etud='"+cneEtudiant+"';";
                rs=st.executeQuery(query);
                while(rs.next()){
                    Object [][] data1 = new Object[1][4];
                    i=1;
                    System.out.println(i);
                    data1[0][0]= rs.getString(1);
                    data1[0][1]= rs.getString(2);
                    data1[0][2]= boxFiliere;
                  resultCon.setModel(setResultModel(data1,columnNames));
                }}else{
                JOptionPane.showMessageDialog(null,"Veuillez remplir les champs avant de rechercher");
            }
        } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
/*
    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem1ActionPerformed
*/
    }
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {                                           
         Document doc = new Document();
        try{
            conn = DriverManager.getConnection(url,"root","");
        st=conn.createStatement();
                            String boxFiliere = filiere_box.getSelectedItem().toString(); 
         String cneEtudiant = cne_txt.getText().trim();
        String query = "SELECT * FROM etudiant where cne_etud like '"+cneEtudiant+"'" ;
         ResultSet infoQuery = st.executeQuery(query);
         while(infoQuery.next()){
            PdfWriter.getInstance(doc , new FileOutputStream("infos.pdf"));
                doc.open();
                SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
                Date now = new Date();
                String date = dt.format(now);
                Paragraph pr = new Paragraph();
                Paragraph dat = new Paragraph();
                Paragraph title = new Paragraph("Relevé de Notes\n\n",FontFactory.getFont(FontFactory.TIMES,20,Font.BOLD,BaseColor.LIGHT_GRAY));
                dat.add(date);
                title.setAlignment(Element.ALIGN_CENTER);
                dat.setAlignment(Element.ALIGN_RIGHT);
                doc.add(dat);
                doc.add(title);
               pr.add("\n CNE : "+infoQuery.getString("cne_etud")+" \n CIN : "+infoQuery.getString("cin_etud")+"\n");
               pr.add("Nom et prenom d'étudiant : "+infoQuery.getString("nom_etud")+" "+infoQuery.getString("prenom_etud")+"\n");
               pr.add("Sexe: "+infoQuery.getString("sexe")+" \n");
               doc.add(pr);
         }
         String note = "SELECT * FROM valid where cne_etud = '"+cneEtudiant+"'" ;
           ResultSet noteQuery = st.executeQuery(note);
           while(noteQuery.next()){
                PdfPTable tb = new PdfPTable(2);
                tb.addCell("Module");
                tb.addCell("Note");
                String noteValid = noteQuery.getString(3);
                String nomModule  = noteQuery.getString(2);
             tb.addCell(nomModule);                 
                tb.addCell(noteValid);
                doc.add(tb);
            //while2
        }//while1  
                doc.close();
                Desktop opn = Desktop.getDesktop();
                if(opn.isSupported(Desktop.Action.OPEN)){
                    opn.open(new File("infos.pdf"));
                }else{
                    System.out.println("Imossible d'ouvrir le fichier ");
                }
        }catch(SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        } catch (DocumentException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }}
    private void btn_modifNoteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_modifNoteActionPerformed
       pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(true);
pan_result.setVisible(false);
pan_add.setVisible(false);
pan_consulter.setVisible(false);
modification_module.setVisible(false);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(false);
     pan_excel.setVisible(false);
try {
            String [] columnNames = new String[]{"Module","Semestre","Note","Session"}; 
            conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
            if(!(cne_txt.getText().equals(""))){
                String cneEtudiant = cne_txt.getText().trim();
                int i=0;  
                  String query = "select v.intitule_module,m.id_semestre,v.note,v.session from module m,valid v "+
                          "where m.intitule_module=v.intitule_module and v.cne_etud='"+cneEtudiant+"';" ;
                rs=st.executeQuery(query);
                while(rs.next()){
                    Object [][] data1 = new Object[1][5];
                    i=1;
                    System.out.println(i);
                    data1[0][0]= rs.getString(1);
                    data1[0][1]= rs.getString(2);
                    data1[0][2]= rs.getString(3);
                    data1[0][3]= rs.getString(4);
                    resultCon.setModel(setResultModel(data1,columnNames));
                }
            }else{
                JOptionPane.showMessageDialog(null,"Veuillez remplir les champs avant de rechercher");
            }
        } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btn_modifNoteActionPerformed

    private void modif_noteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modif_noteActionPerformed
pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(false);
pan_add.setVisible(false);
pan_consulter.setVisible(false);
modification_module.setVisible(false);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(false);
     pan_excel.setVisible(false);

    }//GEN-LAST:event_modif_noteActionPerformed

    private void print_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_print_btnActionPerformed
try {
            MessageFormat header=new MessageFormat("Faculté polydisciplinaire d'ouarzazate");
            //            MessageFormat header=new MessageFormat("Report print"+new ImageIcon(getClass().getClassLoader().getResource("resource/fpo.jpg"));
MessageFormat footer=new MessageFormat("page{0,number,integer}");
           resultCon.print(JTable.PrintMode.NORMAL, header, footer);
            
        } catch (PrinterException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_print_btnActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
this.setVisible(false);
        Authentification g = new Authentification();
        g.setVisible(true);
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
try {
    conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
            if(!(user.getText().equals(""))){
               String motDePass = pass.getText().trim(); 
              
                  String query = "insert into utilisateur values('"+getUser()+"','"+motDePass+"');";
                boolean t=st.execute(query);
                
                if(!t){
                    JOptionPane.showMessageDialog(null, "utilisateur ajouter ");
                    new Gui().setVisible(true);
                    this.setVisible(false);}
                else{
                    JOptionPane.showMessageDialog(null, "incorrecte Veuillez Ressayez");
                   }}
           } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        System.exit(Gui.EXIT_ON_CLOSE);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void addUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addUserActionPerformed
   pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(false);
pan_add.setVisible(true);
pan_consulter.setVisible(false);
modification_module.setVisible(false);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(false);
    }//GEN-LAST:event_addUserActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        new Help().setVisible(true);
        this.setVisible(true);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void userActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_userActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
 pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(false);
pan_add.setVisible(false);
pan_consulter.setVisible(false);
modification_module.setVisible(false);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(false);
     pan_excel.setVisible(false);
cne_txt.setText("");
    }//GEN-LAST:event_jButton3ActionPerformed

    private void reinscrireBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reinscrireBtnActionPerformed
        resultCon.getSelectionModel().addListSelectionListener(new javax.swing.event.ListSelectionListener() {
                    public void valueChanged(ListSelectionEvent event ) {
                   if(resultCon.getValueAt(0,5).equals(true)){
                       Object b=resultCon.getValueAt(0,5);
                       System.out.println(">\t"+resultCon.getSelectedRow());
                       System.out.println(b);
                     System.out.println("hkhkhhh");
                     // ArrayList<Object> liste =new ArrayList<Object>;
                                                             }          }
                                                                                                      });
       try {
            conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
            if(!(cne_txt.getText().equals(""))){
                String cneEtudiant = cne_txt.getText().trim();
                String boxFiliere = filiere_box.getSelectedItem().toString(); 
                System.out.println(boxFiliere);
                int i=0;  
                String query = "select * from valid where "
                   + "cne_etud='"+cneEtudiant+"'";
             rs=st.executeQuery(query);
                   while(rs.next()){
                    i=1;}
            }else{
                JOptionPane.showMessageDialog(null,"Veuillez remplir les champs avant de rechercher");
            }
        } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
       
    }//GEN-LAST:event_reinscrireBtnActionPerformed

    private void supprimer_moduleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_supprimer_moduleActionPerformed
String nModules = getSelectedrow();
        try {
            conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
             String query = "delete from module where module = '"+nModules+"'";
             rs=st.executeQuery(query);
         } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
     }   
    }//GEN-LAST:event_supprimer_moduleActionPerformed

    private void ajout_moduleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ajout_moduleActionPerformed
 pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(false);
pan_add.setVisible(false);
pan_consulter.setVisible(false);
modification_module.setVisible(true);
pan_ajoutModul.setVisible(true);
pan_modifnommod.setVisible(false); 
pan_excel.setVisible(false);

    }//GEN-LAST:event_ajout_moduleActionPerformed

    private void valid_noteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_valid_noteActionPerformed

        try {
         conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
            if(!(cne_txt.getText().equals(""))){
                String cneEtudiant = cne_txt.getText().trim();
                String note = n.getText().trim();
                 String modulee =module.getSelectedItem().toString();
                 String query = "UPDATE valid SET note='"+note+"' WHERE intitule_module ='"+modulee+"' AND cne_etud ='"+cneEtudiant+"'";
                st.executeUpdate(query);
              
                JOptionPane.showMessageDialog(null,"la note est bien modifié");
                
            }else{
                JOptionPane.showMessageDialog(null,"Veuillez remplir les champs avant de rechercher");
            }
       } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
           
    /*
    }//GEN-LAST:event_valid_noteActionPerformed
*/
    private void moduleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moduleActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_moduleActionPerformed

    private void modif_nomModActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modif_nomModActionPerformed
   FileReader md;
     try {
        conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
        String module = module_txt.getText().trim();
        String semestre = semestre_txt.getText().trim();
        
             md = new FileReader("module.txt");
            BufferedReader br = new BufferedReader(md);
            
             try {
                 String  nameMd = br.readLine();
             } catch (IOException ex) {
                 Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
             }
        String query = "UPDATE module SET intitule_module='"+module+"',id_semestre='"+semestre+"' where intitule_module='"+module+"' ";
               st.executeUpdate(query);
     } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_modif_nomModActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
try {
         conn = DriverManager.getConnection(url,"root","");
            st=conn.createStatement();
            String module = module_txt.getText().trim();
        String semestre = semestre_txt.getText().trim();
           
                String query = "Insert INTO module SET intitule_module='"+module+"',id_semestre='"+semestre+"' " ;

             st.executeUpdate(query);
           
        } catch (SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButton7ActionPerformed

    private void nActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_nActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
   Document doc = new Document();
        try{
            conn = DriverManager.getConnection(url,"root","");
        st=conn.createStatement();
                            String boxFiliere = filiere_box.getSelectedItem().toString(); 
         String cneEtudiant = cne_txt.getText().trim();
        String query = "SELECT * FROM etudiant where cne_etud like '"+cneEtudiant+"'" ;
         ResultSet infoQuery = st.executeQuery(query);
         while(infoQuery.next()){
            PdfWriter.getInstance(doc , new FileOutputStream("infos.pdf"));
                doc.open();
                SimpleDateFormat dt = new SimpleDateFormat("yyyy-MM-dd");
                Date dmnt = new Date();
                String date = dt.format(dmnt);
                   Paragraph dat = new Paragraph();
                   dat.add(date);
                Image image = Image.getInstance("images.jpg");
        doc.add(new Paragraph("\n"));
        doc.add(image);
        
        image.setAlignment(Element.ALIGN_CENTER);
        doc.add(new Paragraph("\n",FontFactory.getFont(FontFactory.TIMES_BOLD, 18)));
                Paragraph pr = new Paragraph();
             
                Paragraph title = new Paragraph("Fiche d'etudiant \n\n",FontFactory.getFont(FontFactory.TIMES,20,Font.BOLD,BaseColor.LIGHT_GRAY));
                
                title.setAlignment(Element.ALIGN_CENTER);
                dat.setAlignment(Element.ALIGN_RIGHT);
                doc.add(dat);
                doc.add(title);
               pr.add("\n CNE : "+infoQuery.getString("cne_etud")+" \n CIN : "+infoQuery.getString("cin_etud")+"\n");
               pr.add("Nom et prenom d'étudiant : "+infoQuery.getString("nom_etud")+" "+infoQuery.getString("prenom_etud")+"\n");
               pr.add("Sexe: "+infoQuery.getString("sexe")+" \n");
               doc.add(pr);
         }
         
            String note = "SELECT * FROM valid where cne_etud = '"+cneEtudiant+"'" ;
           ResultSet noteQuery = st.executeQuery(note);
           while(noteQuery.next()){
                PdfPTable tb = new PdfPTable(2);
                tb.addCell("Module");
                tb.addCell("Note");
                String noteValid = noteQuery.getString(3);
                String nomModule  = noteQuery.getString(2);
             
                tb.addCell(nomModule);                 
                tb.addCell(noteValid);
                doc.add(tb);
            //while2
        }//while1  
                doc.close();
                
               
        }catch(SQLException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        } catch (DocumentException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }
        

// TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
try {
            MessageFormat header=new MessageFormat("Report prin");
            //            MessageFormat header=new MessageFormat("Report print"+new ImageIcon(getClass().getClassLoader().getResource("resource/fpo.jpg"));
MessageFormat footer=new MessageFormat("page{0,number,integer}");
           resultCon.print(JTable.PrintMode.NORMAL, header, footer);
            
        } catch (PrinterException ex) {
            Logger.getLogger(Gui.class.getName()).log(Level.SEVERE, null, ex);
        }        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
this.setVisible(false);
        Authentification g = new Authentification();
        g.setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
      pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(false);
pan_add.setVisible(false);
pan_consulter.setVisible(false);
modification_module.setVisible(false);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(false);
pan_excel.setVisible(true);
JFileChooser chooser = new  JFileChooser();
chooser.showOpenDialog(null);
File f =chooser.getSelectedFile();
filename1=f.getAbsolutePath();
attachment_path=f.getAbsolutePath();
path_attachment.setText(attachment_path);
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void path_attachmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_path_attachmentActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_path_attachmentActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
try{
    conn = DriverManager.getConnection(url,"root","");
        st=conn.createStatement();
    BufferedReader br= new BufferedReader(new FileReader(filename1));
    String line;
    int i=0;
    while((line=br.readLine())!=null){
        String[]value=line.split(" ");
        String sql = "insert into etudiant values('"+value[0]+"','"+value[1]+"','"+value[2]+"','"+value[3]+"','"+value[4]+"','"+value[5]+"','"+value[6]+"',v,'"+value[7]+"','"+value[8]+"')";
    ResultSet infoQuery = st.executeQuery(sql);
    i+=1;
    }
    br.close();
    if(i==1){
                    JOptionPane.showMessageDialog(null, "les donnees de  fichier excel sont bien inserees ");
                    
                }
                else{
                    JOptionPane.showMessageDialog(null, "incorrecte Veuillez Ressayez");
                }
}
    catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
    }    

// TODO add your handling code here:
    }//GEN-LAST:event_jButton8ActionPerformed
   public String getSelectedrow(){
    DefaultTableModel model = (DefaultTableModel) resultCon.getModel();
    return (String) resultCon.getValueAt(resultCon.getSelectedRow(),0);
}
   private void registerIdModule(String name) {
        try {
            FileWriter fw = new FileWriter("module.txt");
            PrintWriter pw = new PrintWriter(fw);
            pw.print(name);
            pw.close();
        } catch (IOException ex) {
            System.out.println("Error");
        }
   }
    private void modif_moduleActionPerformed(java.awt.event.ActionEvent evt) {                                             
//new ModificationModule().setVisible(true);
 pan_reinscrire.setVisible(false);
pan_modifModule.setVisible(false);
pan_modifNote.setVisible(false);
Nv_note.setVisible(false);
pan_result.setVisible(false);
pan_add.setVisible(false);
pan_consulter.setVisible(false);
modification_module.setVisible(true);
pan_ajoutModul.setVisible(false);
pan_modifnommod.setVisible(true);
pan_excel.setVisible(false);

         registerIdModule(getSelectedrow());
}                                            

    /**
     * @param args the command line arguments
     */public String getUser(){
        String nomUtilisateur = user.getText().trim();
        return nomUtilisateur;
    }
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Gui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Gui().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Nv_note;
    private javax.swing.JButton addUser;
    private javax.swing.JButton ajout_module;
    private javax.swing.JButton btn_consult;
    private javax.swing.JButton btn_modifModul;
    private javax.swing.JButton btn_modifNote;
    private javax.swing.JButton btn_reinscript;
    private javax.swing.JLabel cne_lab;
    private javax.swing.JTextField cne_txt;
    private javax.swing.JComboBox filiere_box;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton modif_module;
    private javax.swing.JButton modif_nomMod;
    private javax.swing.JButton modif_note;
    private javax.swing.JPanel modification_module;
    private javax.swing.JComboBox module;
    private javax.swing.JTextField module_txt;
    private javax.swing.JTextField n;
    private javax.swing.JPanel pan_add;
    private javax.swing.JPanel pan_ajoutModul;
    private javax.swing.JPanel pan_consulter;
    private javax.swing.JPanel pan_excel;
    private javax.swing.JPanel pan_modifModule;
    private javax.swing.JPanel pan_modifNote;
    private javax.swing.JPanel pan_modifnommod;
    private javax.swing.JPanel pan_reinscrire;
    private javax.swing.JPanel pan_result;
    private javax.swing.JPanel pann_modifmodul;
    private javax.swing.JPasswordField pass;
    private javax.swing.JTextField path_attachment;
    private javax.swing.JButton print_btn;
    private javax.swing.JButton reinscrireBtn;
    private javax.swing.JTable resultCon;
    private javax.swing.JTextField semestre_txt;
    private javax.swing.JButton supprimer_module;
    private javax.swing.JTextField user;
    private javax.swing.JButton valid_note;
    private javax.swing.JButton valider_consult;
    // End of variables declaration//GEN-END:variables
private File file ;
String filename1,File_path,path;
String attachment_path;
}
